<div class="Item hr">
    <span class="fr">现有管理员<b>{$rows_count}</b>位</span>
    <div class="current">管理员列表</div>
</div>

<form action="" method="get">
    <div class="container-fluid">
        <div class="col-sm-12 col-md-2  add-space">
            <div class="input-group">
                <input class="form-control " type="text" name="name" value="{$_GET['name']}" placeholder="email和备注，模糊查询">
            </div>
        </div>
        <div class="col-md-2 add-space">
            <input class="btn btn-primary" type="submit" value="查询">
        </div>
    </div>
</form>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab">
        <thead>
            <tr>
                <td>id</td>
                <td>Email</td>
                <td>角色</td>
                <td>备注</td>
                <td>状态</td>
                <td>创建时间</td>
                <td>最后登录时间</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody>
            <volist name="admins" id="admin">
            <tr align="center">
                <td>{$admin['id']}</td>
                <td>{$admin['email']}</td>
                <td>{$admin['role']['name']}</td>
                <td>{$admin['remark']}</td>
                <td><if condition="$admin['is_active'] eq 1">已启用<else/>已禁用</if></td>
                <td>{:date('Y-m-d H:i:s', $admin['created_at'])}</td>
                <td>{:date('Y-m-d H:i:s', $admin['last_login_at'])}</td>
                <td><if condition="$admin['is_super'] && !$_SESSION[C('ADMIN_AUTH_KEY')]">
                    ---<else/>
                    [ <a href="{:U('Admins/edit', array('id' => $admin['id']))}">编辑</a> ]
                    [ <a href="javascript:void(0)" onclick="editId('{$admin.id}')">修改ID</a> ]
                    </if>
                </td>
            </tr>
            </volist>
        </tbody>
    </table>


<div class="page">
    {$page}
</div>
<script>
    function editId(id){
        var url="{:U('Admins/editId')}?id="+id;
        layer.open({
            type: 2,
            title: '修改ID',
            shadeClose: false,
            shade: 0.5,
            area: ['40%', '40%'],
            content: url
        });
    }
</script>